from paddleocr import TableRecognitionPipelineV2
import os
import json
# 初始化表格识别流水线
table_pipe = TableRecognitionPipelineV2(
    use_doc_orientation_classify=True,  # 自动旋转
)
json_path = "112.json"
# 正确调用：用 .ocr() 方法
img_path = "11.jpeg"
results = table_pipe.predict(img_path)
for res_idx, res in enumerate(results):
    res.save_to_img(f"page_boxed.png")
    res.save_to_json(json_path)
